home *** CD-ROM | disk | FTP | other *** search
- {
- Programming in Turbo Pascal 6.0.
- Turbo Pascal By Example By Greg Perry.
- Chapter 7 Review exercise #4.
- Robert E. Wade 9-4-93
- }
-
- PROGRAM C7RevEx4;
-
- USES Crt;
-
- CONST Spc = ' ';
- RegPay = 4.50;
- TimeAndHalf = RegPay * 1.5;
- DoubleTime = RegPay * 2;
- TaxRate = 0.28;
- RegHours = 40;
- TaHHours = 5;
- DblTimeHrs = 5;
-
- { Define Constants that perform the calculations }
-
- GrossPay = (RegPay * RegHours) + (TimeAndHalf * TaHHours) +(DoubleTime * DblTimeHrs);
- Taxes = GrossPay * TaxRate;
- NetPay = GrossPay - Taxes;
-
- BEGIN
- CLRSCR;
-
- { Display data to screen }
-
- WRITELN( 'Gross Pay is: ', GrossPay:8:2 );
- WRITELN( 'Taxes are: ', Spc:2, Taxes:8:2 );
- WRITELN( 'Net Pay is: ', Spc:2, NetPay:8:2 );
- END.